package com.ctshk.rpc.custom.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.custom.base.CustomBaseMapper;
import com.ctshk.rpc.custom.dto.quotation.TouristPriceDTO;
import com.ctshk.rpc.custom.entity.CustomizedTripScheduleQuoteServiceItems;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 团期套餐行程报价服务项目 Mapper 接口
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-01-21
 */
public interface CustomizedTripScheduleQuoteServiceItemsMapper extends CustomBaseMapper<CustomizedTripScheduleQuoteServiceItems> {


    /**
     * 改为已删除
     * @param dateId
     * @param userId
     * @return
     */
    @Update("UPDATE t_customized_trip_schedule_quote_service_items \n" +
            "SET is_deleted = 1,modified_id = #{modified_id}\n" +
            "WHERE date_id = #{date_id}")
    Integer clearByDate(@Param("date_id") Long dateId, @Param("modified_id")Long userId);

    /**
     * 清空服务项目
     * @param scheduleId
     * @param userId
     */
    @Update("UPDATE t_customized_trip_schedule_quote_service_items \n" +
            "SET is_deleted = 1,modified_id = #{user_id}\n" +
            "WHERE schedule_id = #{schedule_id} AND is_deleted = 0")
    Integer cleanBySchedule(@Param("schedule_id") Long scheduleId,@Param("user_id") Long userId);
}
